package com.ibl.rover.lite.common.bean;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;

public class DefaultRouteBean extends BaseBean{

	@ColumnOrder(Order = 1)
	private String routeCode;
	

	private static AutomatedQueryStatement AUTO_GEN_QUERY;

	public static final String COL_ROUTE_CODE = "ROUTE_CODE";
	

	public static final int IDX_COL_ROUTE_CODE = 1;
	

	static {
		AUTO_GEN_QUERY = SQLiteDatabaseHelper
				.getAutoGeneratedStmts(DefaultRouteBean.class);
	}

	
	@Override
	public String getCreateTableQuery() {

		return AUTO_GEN_QUERY.getCreateTableQuery();
	}

	@Override
	public String getInsertQuery() {

		return AUTO_GEN_QUERY.getPreparedInsertQuery();
	}

	@Override
	public String getDeleteQuery() {

		return AUTO_GEN_QUERY.getPreparedDeleteQuery();
	}

	@Override
	public String getUpdateQuery() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getTableName() {

		return AUTO_GEN_QUERY.getTableName();
	}


	@Override
	public void bind(SQLiteStatement sqlLiteStatement) {
		sqlLiteStatement.bindString(IDX_COL_ROUTE_CODE, routeCode);
		
	}

	@Override
	public <T extends BaseBean> T cursorBind(Cursor cursor) {
		DefaultRouteBean defaultRouteBean = new DefaultRouteBean();
		defaultRouteBean.set_id(cursor.getInt(IDX_COL_ID));
		defaultRouteBean.setRouteCode(cursor.getString(IDX_COL_ROUTE_CODE));
		return (T) defaultRouteBean;
	}

	@Override
	public <T extends BaseBean> T cursorInit(Cursor cursor) {
		 this.set_id(cursor.getInt(IDX_COL_ID));
		this.setRouteCode(cursor.getString(IDX_COL_ROUTE_CODE));
		return (T)this;
	}

	@Override
	public ContentValues bindContentValues() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getRouteCode() {
		return routeCode;
	}

	public void setRouteCode(String routeCode) {
		this.routeCode = routeCode;
	}

}
